/**
 * 登录api
 * @param {*} body
 * @returns
 */
import {getSystemId} from "@/config/common.js";

export const useLoginApi = (body) => {
    return useHttpPost("/login/toLogin",{body})
}

/**
 * 手机登录
 * @param {*} body
 * @returns
 */
export const useLoginByPhoneCodeApi = (body) => {
    return useHttpPost("/login/phonecode",{body})
}

/**
 * 注册api
 * @param {*} body
 * @returns
 */
export const useRegApi = (body) => {
    return useHttpPost("/login/reg",{body})
}

/**
 * 退出登录
 * @param {*} body 
 * @returns 
 */
export const useLogoutApi = () => {
    return useHttpPost("/v1/login/logout",{})
}

/**
 * 获取登录的用户信息
 * @returns 
 */
export const useGetLoginUserInfoApi = () => {
    return useHttpPost("/v1/user/getUserInfo",{})
}

/**
 * 设置手机
 * @returns
 */
export const useSettingPhoneApi = (body) => {
    return useHttpPost("/v1/login/setting/phone",{body})
}


/**
 * 微信登录
 * @returns
 */
export const useWexinLoginCallbackApi = (state,userId) => {
    return useHttpPost(`/login/weixin/callback?state=${state}&systemid=${getSystemId}&userId=${userId}`,{})
}
